//
//  MineAboutTableViewCell.m
//  MJApp
//
//  Created by wangliang on 15/3/30.
//  Copyright (c) 2015年 wangliang. All rights reserved.
//

#import "MineAboutTableViewCell.h"

@interface MineAboutTableViewCell ()
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UILabel *descLabel;
@property (weak, nonatomic) IBOutlet UILabel *endLabel;
@property (weak, nonatomic) IBOutlet UILabel *NLabel;

@end

@implementation MineAboutTableViewCell

+ (instancetype)initWithTableView:(UITableView *)tableView {
    
    static NSString *cellID = @"MineAboutTableViewCell";
    MineAboutTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
    if (cell == nil) {
        
        cell =  WL_XIB(@"MineAboutTableViewCell");
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    cell.cellHigh = CGRectGetHeight(cell.frame);
    return cell;
    
}

- (void)setInfoDic:(NSDictionary *)infoDic {
    
    _infoDic = infoDic;
    self.nameLabel.text = infoDic[@"name"];
    self.descLabel.text = infoDic[@"desc"];
    self.endLabel.text = infoDic[@"end"];
    if ([infoDic[@"new"] isEqualToString:@""]) {
        
        self.NLabel.hidden = YES;
    }else {
        
        self.NLabel.hidden = NO;
    }
}

- (void)awakeFromNib {
    // Initialization code
    
    self.NLabel.layer.cornerRadius = CGRectGetHeight(self.NLabel.frame) / 2;
    self.NLabel.clipsToBounds = YES;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
